package com.example.spring4.service.impl;


import com.example.spring4.dao.IUserDao;
import com.example.spring4.model.User;
import com.example.spring4.service.IUserService;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements IUserService {
    @Autowired
    private IUserDao userDao;

    @Override
    public User getUserById() {
        int id=1;
        User user =userDao.getUserById(id);
        System.out.println("service层调用");
        System.out.println("id="+user.getId());
        return null;
    }

    @Override
    public int insertUser(User user) {
        userDao.insertUser(user);
        return 0;
    }
}
